import request from '@/utils/request'

// 查询货品分类列表
export function listItemCategory(query) {
  return request({
    url: '/wms/itemCategory/list',
    method: 'get',
    params: query
  })
}

// 查询货品分类树形列表
export function treeListItemCategory(query) {
  return request({
    url: '/wms/itemCategory/treeList',
    method: 'get',
    params: query
  })
}

// 查询货品分类详细
export function getItemCategory(categoryId) {
  return request({
    url: '/wms/itemCategory/' + categoryId,
    method: 'get'
  })
}

// 新增货品分类
export function addItemCategory(data) {
  return request({
    url: '/wms/itemCategory',
    method: 'post',
    data: data
  })
}

// 修改货品分类
export function updateItemCategory(data) {
  return request({
    url: '/wms/itemCategory',
    method: 'put',
    data: data
  })
}

// 删除货品分类
export function delItemCategory(categoryId) {
  return request({
    url: '/wms/itemCategory/' + categoryId,
    method: 'delete'
  })
}

// 货品分类状态修改
export function changeItemCategoryStatus(data) {
  return request({
    url: '/wms/itemCategory/changeStatus',
    method: 'put',
    data: data
  })
}

// 校验分类编码是否唯一
export function checkCategoryCodeUnique(categoryCode, categoryId) {
  return request({
    url: '/wms/itemCategory/checkCategoryCodeUnique',
    method: 'get',
    params: {
      categoryCode,
      categoryId
    }
  })
} 